public class Test8 {
    public static void main(String[] args) {
        int[] arr = {1,2,3,5,7,8,10};
        int count = 0;
        for (int i = 0; i < arr.length; i++) {
            count = 1;
            if(arr[i] % 2 != 0) {
                for (int j = i + 1; j < arr.length; j++) {
                    if(arr[j] % 2 != 0) {
                        count++;
                    }
                }
            }
            if(count == 3) {
                for (int k = i; k < i+3; k++) {
                    System.out.print(arr[k] + " ");
                }
            }
        }
    }
}
